home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n12.arc
/
DIRANY.BAT
< prev
next >
Wrap
DOS Batch File
|
1990-05-29
|
821b
|
37 lines
DIRANY.BAT
@ECHO OFF
IF '%2'=='' GOTO syntax
FOR %%v IN (1 2 3 4 5 6 7 8) DO IF %2==%%v GOTO OK
GOTO syntax
:OK
SET temp=%1*.*
rem If name has 8 letters, we're done
IF %2==8 GOTO doit
SET temp=%temp% ?%1*.*
IF %2==7 GOTO doit
SET temp=%temp% ??%1*.*
IF %2==6 GOTO doit
SET temp=%temp% ???%1*.*
IF %2==5 GOTO doit
SET temp=%temp% ????%1*.*
IF %2==4 GOTO doit
SET temp=%temp% ?????%1*.* *.%1*
IF %2==3 GOTO doit
SET temp=%temp% ??????%1*.* *.?%1*
IF %2==2 GOTO doit
SET temp=%temp% ???????%1.* *.??%1
:doit
FOR %%f IN (%temp%) DO ECHO %%f
SET temp=
GOTO end
:syntax
ECHO DIRANY lists files whose names contain a certain string.
ECHO Syntax: "DIRANY string n"
ECHO where "string" is a string of 1 to 8 characters
ECHO (no wildcards) and "n" is the length of that string.
:end